package com.twu.biblioteca;

import com.twu.biblioteca.controller.UserController;
import com.twu.biblioteca.models.User;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: magesh kumar
 * Date: 29/08/13
 * Time: 6:27 AM
 * To change this template use File | Settings | File Templates.
 */
public class UserInitializer {

    private User user1;
    private User user2;
    private List<User> userList;

    private List<User> createSampleUserList() throws Exception {
        user1 = User.createUser("password");
        user1.setName("Magesh Kumar");
        user1.setEmail("ema93sh@gmail.com");
        user1.setPhoneNo("9445533677");
        user2 = User.createUser("password");
        user2.setName("Steve Jobs");
        user2.setEmail("steve@icloud.com");
        userList = new ArrayList<User>();
        userList.add(user1);
        userList.add(user2);
        return userList;
    }

    public UserController createSampleUserController() throws Exception {
        return new UserController( createSampleUserList() );
    }

    public List<User> getUserList() {
        return userList;
    }
}
